package com.xhwl.centiotdata.handler.talk;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: wuyuhao
 * @createDate: 2022/12/1 10:37
 */
public class TalkIntegrationFactory {

    private static Map<Integer, TalkIntegrationHandler> handlerMap = new HashMap<>();

    public static TalkIntegrationHandler getInvokeStrategy(Integer id) {
        return handlerMap.get(id);
    }

    public static void register(Integer id, TalkIntegrationHandler handler) {
        if (StringUtils.isEmpty(id)) {
            return;
        }
        handlerMap.put(id, handler);
    }

}
